

#include "subwindowmanager.h"

SubWindowManager& SubWindowManager::instance()
{
	static SubWindowManager instance;
	return instance;
}
SubWindowManager::~SubWindowManager()
{
}

void SubWindowManager::registerWidget(QString widgetName, QWidget* widget)
{
	m_widgets.insert(widgetName, widget);
}

void SubWindowManager::unregisterWidget(QString widgetName)
{
	auto widget = m_widgets[widgetName];
	if (widget != nullptr)
	{
		m_widgets.remove(widgetName);
	}
}
QWidget* SubWindowManager::widgetInstance(QString widgetName)
{
	return m_widgets[widgetName];
}
SubWindowManager::SubWindowManager() : m_widgets({})
{
}
